package ai;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class RGB {
	public static void main(String[] args) {
		BufferedImage img = null;
		try { img = ImageIO.read(new File(args[0]));
		}
		catch (IOException e) {
		}
		int x = img.getWidth();
		int y = img.getHeight();
		String[][] immagine = new String[x][y];
		for(int j=0; j<y; j++) {
			for(int i=0; i<x; i++) {
				immagine[i][j] = Integer.toHexString(img.getRGB(i,j));
			}
		}
		for(int j=0; j<y; j++) {
			for(int i=0; i<x; i++) {
				System.out.print(immagine[i][j]+"|");
			}
			System.out.println();
		}
	}

}
